#ifndef  HELPER_OBJECT_STRING_H
#define  HELPER_OBJECT_STRING_H

#include "helper/object/Object.h"

namespace helper {
namespace object {

/**
 * String data interface
 *
 * @since 0.1
 */
class String : public Object{
public:
    String() : Object(Object::STRING){}
    ~String() override {}

    /**
     * @param value  set the std::string value
     */
    virtual void setValue(const std::string & value) = 0;
    /**
     * @return  get the std::string & for value
     */
    virtual const std::string & getValue() const = 0;
    /**
     * @return the length of value with char(byte)
     */
    virtual size_t size() const = 0;

    /**
     * append the character to value 
     * @param ch character to be appended
     */
    virtual void append(char ch) = 0;
    /**
     * append the std::string to value
     * @param str std::string to be appended
     */
    virtual void append(const std::string & str) = 0;

    virtual void clear() = 0;


    bool operator ==(const String & right) const {
        return equals(right);
    }
    bool operator !=(const String & right) const{
        return !(*this == right);
    }
    bool operator ==(const std::string & right) const {
        return getValue() == right;
    }
    bool operator !=(const std::string & right) const{
        return !(*this == right);
    }
};
bool operator ==(const std::string & left, const String & right) ;
bool operator !=(const std::string & left, const String & right) ;

} // end of namespace object
} // end of namespace helper


#endif   /* HELPER_OBJECT_STRING_H */
